﻿<Window x:Class="IllSoft.Xvcc.WpfUI.TestWindow2"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:sys="clr-namespace:System;assembly=mscorlib"
       Title="TestWindow" Height="700" Width="800">

    <Window.Resources>
        <XmlDataProvider x:Key="datas" XPath="/PersonList">
            <x:XData>
                <PersonList xmlns="">
                    <Person LastName="TOTO" FirstName="a" Picture=""/>
                    <Person LastName="TATA" FirstName="a" Picture=""/>
                    <Person LastName="TUTU" FirstName="a" Picture=""/>
                    <Person LastName="TITI" FirstName="a" Picture=""/>
                </PersonList>
            </x:XData>
        </XmlDataProvider>

        <DataTemplate x:Key="ItemSmall">
            <Border x:Name="border" Width="100" Height="100" BorderBrush="#FFFFFFFF" 
                   BorderThickness="1,1,1,1" RenderTransformOrigin="0.5,0.5">
                <Border.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <TranslateTransform X="0" Y="0"/>
                    </TransformGroup>
                </Border.RenderTransform>

                <Grid Width="Auto" Height="Auto">
                    <Border Width="Auto" Height="Auto" Background="Blue">
                    </Border>
                    <TextBlock Text="{Binding XPath=@LastName}" TextWrapping="Wrap" VerticalAlignment="Bottom" Background="#D7D3D3D3" Foreground="#FF000000" FontSize="10" FontWeight="Bold" FontFamily="Segoe UI" TextAlignment="Center"/>
                </Grid>
            </Border>
        </DataTemplate>
    </Window.Resources>

    <Grid>
        <ListView ItemsSource="{Binding Source={StaticResource datas}, XPath=Person}"
            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
            ItemTemplate="{StaticResource ItemSmall}">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Panel.ZIndex" Value="{x:Static sys:Int32.MaxValue}"/>
                            <Setter Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                                </Setter.Value>
                            </Setter>
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ParallelTimeline BeginTime="0:0:0">
                                            <DoubleAnimation Duration="00:00:00.2000000" To="1.5" Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)"/>
                                            <DoubleAnimation Duration="00:00:00.2000000" To="1.5" Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleX)"/>
                                        </ParallelTimeline>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ParallelTimeline BeginTime="0:0:0">
                                            <DoubleAnimation Duration="00:00:00.2000000" To="1" Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)"/>
                                            <DoubleAnimation Duration="00:00:00.2000000" To="1" Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleX)"/>
                                        </ParallelTimeline>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel />
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
        </ListView>
        <RichTextBox Height="300" Name="richTextBox1" Width="500">
            <FlowDocument>
                <Paragraph Background="#312d5a">
                    <Bold>
                        <TextBlock Foreground="#bb00ff"><Bold>Eigene Texte?</Bold></TextBlock>
                        <LineBreak />
                        <TextBlock Foreground="#e7ebce">Textfarbe</TextBlock>
                        <LineBreak />
                        <TextBlock Foreground="#fffbff">Nick</TextBlock>
                        <LineBreak />
                        <TextBlock Foreground="#bdabda">TextBlock4</TextBlock>
                        <LineBreak />
                        <TextBlock Foreground="#00d8ff">TextBlock5</TextBlock>
                        <LineBreak />
                        <TextBlock Foreground="#ced7ff">TextBlock6</TextBlock>
                        <LineBreak />
                        <TextBlock Foreground="#e7ebce">[23:43:13]</TextBlock>
                        <TextBlock Foreground="#fffbff">(Irgend'n Nick)</TextBlock>
                        <TextBlock Foreground="#e7ebce">Irgend ein Text, egal wie lang</TextBlock>
                        <LineBreak />
                        [23:43:13] {IrgendEin Nick} Sein Test Text
                        <Line Fill="Aquamarine"></Line>
                        [23:43:13] {IrgendEin Nick} Sein Test Text
                    </Bold>
                </Paragraph>
            </FlowDocument>
        </RichTextBox>
    </Grid>
</Window>